Partial Translation: Towards a Portable and Efficient Prolog Implementation Technology
نویسندگان
چکیده
We describe a new language translation framework (partial translation) and the application of one of its instances: the C-iication of Binary Prolog. Our partial translation framework compiles selected sequences of em-ulator instructions down to native code. The technique can be seen as an automatic specialization with respect to a given program of the traditional instruction folding techniques used to speed-up emulators. In our implementation, the complex control structure, some large instructions and the management of the symbol table are left to the emulator while the translated code deals with relatively long sequences of simple instructions. After compilation, the generated code is linked with a target language representation of the emulator's byte-code and the emulator itself to form a stand-alone application. The composite run-time system's behavior can be seen as a form of`coroutining' between emulated and native code. The framework supports modular compilation, allows programmer control of the speed vs. size optimization, is fully portable and has a performance that ranges between the performance of emulated code and that of native code. Our design has been proven practical in the implementation of the C-code generator of a fairly complete multi-platform Prolog system (BinProlog) available by ftp at clement.info.umoncton.ca.
منابع مشابه
Partial Translation: towards a Portable and Eecient Prolog Implementation Technology
We describe a new language translation framework (partial translation) and the application of one of its instances: the C-iication of Binary Prolog. Our partial translation framework compiles selected sequences of em-ulator instructions down to native code. The technique can be seen as an automatic specialization with respect to a given program of the traditional instruction folding techniques ...
متن کاملDyna: A Declarative Language for Implementing Dynamic Programs
We present the first version of a new declarative programming language. Dyna has many uses but was designed especially for rapid development of new statistical NLP systems. A Dyna program is a small set of equations, resembling Prolog inference rules, that specify the abstract structure of a dynamic programming algorithm. It compiles into efficient, portable, C++ classes that can be easily invo...
متن کاملDyna: A Language for Weighted Dynamic Programming
We present the first version of a new declarative programming language. Dyna has many uses but was designed especially for rapid development of new statistical NLP systems. A Dyna program is a small set of equations, resembling Prolog inference rules, that specify the abstract structure of a dynamic programming algorithm. It compiles into efficient, portable, C++ classes that can be easily invo...
متن کاملQD-Janus: a Sequential Implementation of Janus in Prolog
Janus is a language designed for distributed constraint programming. This paper describes QDJanus, a sequential implementation of Janus in Prolog. The compiler uses a number of novel analyses and optimizations to improve the performance of the system. The choice of Prolog as the target language for a compiler, although unusual, is motivated by the following: (i) the semantic gap between Janus a...
متن کاملA Prolog Interpreter in Python
We provide a proof-of-concept for a new approach to flexible and portable implementation of programming languages. More precisely, we describe the implementation of a Prolog interpreter in RPython, a restricted subset of the Python language intended for system programming. RPython can be translated using the PyPy compilation and specialization tool-set to various platforms, among them C/Posix a...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- J. Log. Program.
دوره 29 شماره
صفحات -
تاریخ انتشار 1996